﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Q.Framework.Data
{
    [AttributeUsage(AttributeTargets.Property)]
    public class PrimaryKey : Attribute
    {

    }

    [AttributeUsage(AttributeTargets.Property)]
    public class MaxLength : Attribute
    {
        public MaxLength() { }
        public MaxLength(Int32 value) { Value = value; }

        public Int32 Value { get; set; }
    }

    [AttributeUsage(AttributeTargets.Property)]
    public class Required : Attribute
    {

    }

    [AttributeUsage(AttributeTargets.Property)]
    public class FriendlyName : Attribute
    {
        public FriendlyName() { }
        public FriendlyName(String value) { Value = value; }

        public String Value { get; set; }
    }

    [AttributeUsage(AttributeTargets.Property)]
    public class Relationship : Attribute
    {
        public Relationship() { }
        public Relationship(RelationshipType value) { Value = value; }

        public RelationshipType Value { get; set; }
    }

    public enum RelationshipType
    {
        OneToOne,
        OneToZeroOrOne,
        OneToMany,
        ManyToMany,
    }

    [AttributeUsage(AttributeTargets.Property)]
    public class ShowInCrudForm : Attribute
    {

    }
}
